Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with ikos-scan-cc (#17). #16

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

xfiderek
Copy link
Contributor

@xfiderek xfiderek commented Feb 20, 2024

This commit fixes compilation with ikos-scan-cc compiler, by modifying linker flags. Refer to problem B described in space-ros/docker#138 for more details. I have verified that compilation works fine with gcc and clang after adding these flags.

Of course, I can create a separate issue for this in ament cobra repo if needed. I am also open to alternative solutions (e.g. modifying cobra makefile).

@xfiderek xfiderek changed the title Fix compilation with ikos-scan-cc (space-ros/docker#132). Fix compilation with ikos-scan-cc (space-ros/docker#138). Feb 20, 2024
@ivanperez-keera
Copy link
Collaborator

ivanperez-keera commented Aug 22, 2024

Can you modify the commit message to close issue #17? Thanks!

@xfiderek xfiderek changed the title Fix compilation with ikos-scan-cc (space-ros/docker#138). Fix compilation with ikos-scan-cc (#17). Oct 1, 2024
@xfiderek
Copy link
Contributor Author

xfiderek commented Oct 1, 2024

@ivanperez-keera done!

Building cobra_vendor package fails when ikos-scan-cc is used as a
compiler.

For a command like:
```
ikos-scan-cc -Wall -pedantic -Werror -Wshadow -O2 -DYY_NO_INPUT -I. -std=c99 -o scope_check scope_check.c cwe_util.c c.ar -pthread
```

the following error message is printed:
```
clang: error: c.ar: 'linker' input unused [-Werror,-Wunused-command-line-argument]
```

Changing the end of the compile command from `c.ar -pthread` to `-Wl,c.ar
-pthread` fixes the issue.

This commit addresses the issue by modifying the linker flags in the
CMakeLists.txt.
@ivanperez-keera ivanperez-keera merged commit e51bc71 into ament:master Oct 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building cobra_vendor package fails when ikos-scan-cc is used as a compiler
2 participants